﻿import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtQml.XmlListModel

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("QCustomPlot在QML中使用")

//    Item {
//        id: mainView
//        anchors.fill: parent
//        PlotView {
//        }
//    }
    SwipeView {
        id: swipeView
        anchors.fill: parent
        currentIndex: tabBar.currentIndex
        interactive: false

        DDRubberband{
        }
        PlotView {
        }

        MarketPlotView {

        }

        CustomPlotBar{

        }
        CustomKLine{

        }
        CustomColorMap{

        }
        CustomBarCharts{}
        // Page {
        //     Label {
        //         text: qsTr("This is implementation of http://www.qcustomplot.com/index.php/support/forum/172\n" +
        //                    "Adding random data on 500 ms tick to plot")
        //         anchors.centerIn: parent
        //     }
        //     XmlListModel {
        //         id: xmlModel
        //         source: "qrc:/combox.xml"
        //         query: "/rss/item"
        //         XmlRole { name: "title"; query: "title/string()" }
        //         XmlRole { name: "pubDate"; query: "pubDate/string()" }
        //     }
        //     ComboBox {
        //         textRole: "title"
        //         model: xmlModel
        //     }
        // }
    }

    footer: TabBar {
        id: tabBar
        currentIndex: swipeView.currentIndex
        TabButton {
            text: qsTr("RubberBand")
        }
        TabButton {
            text: qsTr("Plot")
        }
        TabButton {
            text: qsTr("Market")
        }
        TabButton {
            text: qsTr("Bar")
        }
        TabButton {
            text: qsTr("KLine")
        }
        TabButton {
            text: qsTr("ColorMap")
        }
        TabButton {
            text: qsTr("BarChart")
        }
        TabButton {
            text: qsTr("Info")
        }
    }
}
